application of the pythagoras theorem